AC_DEFUN([AC_PYTHON_MODULE],
[
AC_MSG_CHECKING([for $1 python module])
res=`$PYTHON -c "
try:
  import $1
  print 'yes'
except:
  print 'no'" 2>/dev/null`
AC_MSG_RESULT([$res])
if test "$res" != "yes"; then
  AC_MSG_ERROR([Could not import $1 python module])
fi
])